package com.liang.crawlertx2.service;

import com.liang.crawlertx2.dao.NewDao;
import com.liang.crawlertx2.pojo.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewServiceImpl implements NewService {
    @Autowired
    private NewDao newDao;

    @Override
    public void saveNew(News news) {
        newDao.save(news);
    }

    @Override
    public List<News> findAll() {
        return newDao.findAll();
    }

    @Override
    public List<News> findByUrl(String url) {
        return newDao.findByUrl(url);
    }
}
